home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.1 / libpbm.1 < prev    next >
Text File  |  1995-07-25  |  8KB  |  199 lines

  1.  
  2.  
  3.  
  4.      lllliiiibbbbppppbbbbmmmm((((3333))))                XXXXEEEENNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                 lllliiiibbbbppppbbbbmmmm((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           libpbm - functions to support portable bitmap programs
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           #include <pbm.h>
  13.           cc ... libpbm.a
  14.  
  15.  
  16.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN ---- PPPPAAAACCCCKKKKAAAAGGGGEEEE----WWWWIIIIDDDDEEEE RRRROOOOUUUUTTTTIIIINNNNEEEESSSS
  17.         KKKKEEEEYYYYWWWWOOOORRRRDDDD MMMMAAAATTTTCCCCHHHHIIIINNNNGGGG
  18.           int pm_keymatch( char* str, char* keyword, int minchars )
  19.  
  20.           Does a case-insensitive match of ssssttttrrrr against kkkkeeeeyyyywwwwoooorrrrdddd.  ssssttttrrrr
  21.           can be a leading sunstring of kkkkeeeeyyyywwwwoooorrrrdddd, but at least mmmmiiiinnnncccchhhhaaaarrrrssss
  22.           must be present.
  23.  
  24.         LLLLOOOOGGGG BBBBAAAASSSSEEEE TTTTWWWWOOOO
  25.           int pm_maxvaltobits( int maxval )
  26.           int pm_bitstomaxval( int bits )
  27.  
  28.           Convert between a maxval and the minimum number of bits
  29.           required to hold it.
  30.  
  31.         MMMMEEEESSSSSSSSAAAAGGGGEEEESSSS AAAANNNNDDDD EEEERRRRRRRROOOORRRRSSSS
  32.           void pm_message( char* fmt, ... )
  33.  
  34.           pppprrrriiiinnnnttttffff(((()))) style routine to write an informational message.
  35.  
  36.           void pm_error( char* fmt, ... )
  37.  
  38.           pppprrrriiiinnnnttttffff(((()))) style routine to write an error message and abort.
  39.  
  40.           void pm_usage( char* usage )
  41.  
  42.           Write a usage message.  The string should indicate what
  43.           arguments are to be provided to the program.
  44.  
  45.         GGGGEEEENNNNEEEERRRRIIIICCCC FFFFIIIILLLLEEEE MMMMAAAANNNNAAAAGGGGEEEEMMMMEEEENNNNTTTT
  46.           FILE* pm_openr( char* name )
  47.  
  48.           Open the given file for reading, with appropriate error
  49.           checking.  A filename of "-" is taken as equivalent to
  50.           stdin.
  51.  
  52.           FILE* pm_openw( char* name )
  53.  
  54.           Open the given file for writing, with appropriate error
  55.           checking.
  56.  
  57.           void pm_close( FILE* fp )
  58.  
  59.           Close the file descriptor, with appropriate error checking.
  60.  
  61.  
  62.  
  63.      Page 1                                           (printed 9/7/93)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      lllliiiibbbbppppbbbbmmmm((((3333))))                XXXXEEEENNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                 lllliiiibbbbppppbbbbmmmm((((3333))))
  71.  
  72.  
  73.  
  74.         EEEENNNNDDDDIIIIAAAANNNN IIII////OOOO
  75.           int pm_readbigshort( FILE* in, short* sP )
  76.           int pm_writebigshort( FILE* out, short s )
  77.           int pm_readbiglong( FILE* in, long* lP )
  78.           int pm_writebiglong( FILE* out, long l )
  79.           int pm_readlittleshort( FILE* in, short* sP )
  80.           int pm_writelittleshort( FILE* out, short s )
  81.           int pm_readlittlelong( FILE* in, long* lP )
  82.           int pm_writelittlelong( FILE* out, long l )
  83.  
  84.           Routines to read and write short and long ints in either
  85.           big- or little-endian byte order.
  86.  
  87.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN ---- PPPPBBBBMMMM----SSSSPPPPEEEECCCCIIIIFFFFIIIICCCC RRRROOOOUUUUTTTTIIIINNNNEEEESSSS
  88.         TTTTYYYYPPPPEEEESSSS AAAANNNNDDDD CCCCOOOONNNNSSSSTTTTAAAANNNNTTTTSSSS
  89.           typedef ... bit;
  90.           #define PBM_WHITE ...
  91.           #define PBM_BLACK ...
  92.  
  93.           each bbbbiiiitttt should contain only the values of PPPPBBBBMMMM____WWWWHHHHIIIITTTTEEEE or
  94.           PPPPBBBBMMMM____BBBBLLLLAAAACCCCKKKK.
  95.  
  96.           #define PBM_FORMAT ...
  97.           #define RPBM_FORMAT ...
  98.           #define PBM_TYPE PBM_FORMAT
  99.           #define PBM_FORMAT_TYPE(f) ...
  100.  
  101.           For distinguishing different file formats and types.
  102.  
  103.         IIIINNNNIIIITTTTIIIIAAAALLLLIIIIZZZZAAAATTTTIIIIOOOONNNN
  104.           void pbm_init( int* argcP, char* argv[] )
  105.  
  106.           All PBM programs must call this routine.
  107.  
  108.         MMMMEEEEMMMMOOOORRRRYYYY MMMMAAAANNNNAAAAGGGGEEEEMMMMEEEENNNNTTTT
  109.           bit** pbm_allocarray( int cols, int rows )
  110.  
  111.           Allocate an array of bits.
  112.  
  113.           bit* pbm_allocrow( int cols )
  114.  
  115.           Allocate a row of the given number of bits.
  116.  
  117.           void pbm_freearray( bit** bits, int rows )
  118.  
  119.           Free the array allocated with ppppbbbbmmmm____aaaallllllllooooccccaaaarrrrrrrraaaayyyy(((()))) containing
  120.           the given number of rows.
  121.  
  122.           void pbm_freerow( bit* bitrow )
  123.  
  124.           Free a row of bits.
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                           (printed 9/7/93)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      lllliiiibbbbppppbbbbmmmm((((3333))))                XXXXEEEENNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                 lllliiiibbbbppppbbbbmmmm((((3333))))
  137.  
  138.  
  139.  
  140.         RRRREEEEAAAADDDDIIIINNNNGGGG FFFFIIIILLLLEEEESSSS
  141.           void pbm_readpbminit( FILE* fp, int* colsP, int* rowsP, int* formatP )
  142.  
  143.           Read the header from a PBM file, filling in the rows, cols
  144.           and format variables.
  145.  
  146.           void pbm_readpbmrow( FILE* fp, bit* bitrow, int cols, int format )
  147.  
  148.           Read a row of bits into the bitrow array.  Format and cols
  149.           were filled in by ppppbbbbmmmm____rrrreeeeaaaaddddppppbbbbmmmmiiiinnnniiiitttt(((()))).
  150.  
  151.           bit** pbm_readpbm( FILE* fp, int* colsP, int* rowsP )
  152.  
  153.           Read an entire bitmap file into memory, returning the
  154.           allocated array and filling in the rows and cols variables.
  155.           This function combines ppppbbbbmmmm____rrrreeeeaaaaddddppppbbbbmmmmiiiinnnniiiitttt(((()))), ppppbbbbmmmm____aaaallllllllooooccccaaaarrrrrrrraaaayyyy(((())))
  156.           and ppppbbbbmmmm____rrrreeeeaaaaddddppppbbbbmmmmrrrroooowwww(((()))).
  157.  
  158.         WWWWRRRRIIIITTTTIIIINNNNGGGG FFFFIIIILLLLEEEESSSS
  159.           void pbm_writepbminit( FILE* fp, int cols, int rows, int forceplain )
  160.  
  161.           Write the header for a portable bitmap file.  The forceplain
  162.           flag forces a plain-format file to be written, as opposed to
  163.           a raw-format one.
  164.  
  165.           void pbm_writepbmrow( FILE* fp, bit* bitrow, int cols, int forceplain )
  166.  
  167.           Write a row from a portable bitmap.
  168.  
  169.           void pbm_writepbm( FILE* fp, bit** bits, int cols, int rows, int forceplain )
  170.  
  171.           Write the header and all data for a portable bitmap.  This
  172.           function combines ppppbbbbmmmm____wwwwrrrriiiitttteeeeppppbbbbmmmmiiiinnnniiiitttt(((()))) and ppppbbbbmmmm____wwwwrrrriiiitttteeeeppppbbbbmmmmrrrroooowwww(((()))).
  173.  
  174.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  175.           libpgm(3), libppm(3), libpnm(3)
  176.  
  177.      AAAAUUUUTTTTHHHHOOOORRRR
  178.           Copyright (C) 1989, 1991 by Tony Hansen and Jef Poskanzer.
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                           (printed 9/7/93)
  196.  
  197.  
  198.  
  199.